Skip to content

fix: add platform-detecting wrapper at miners/fingerprint_checks.py [FaaFyfxR9WAQrL7FcAgEHJvztd8cVMxvjHRS55rw1nwH] - #8070

Closed
waterWang wants to merge 3 commits into
Scottcjn:mainfrom
waterWang:fix/8031-windows-miner-path
Closed

fix: add platform-detecting wrapper at miners/fingerprint_checks.py [FaaFyfxR9WAQrL7FcAgEHJvztd8cVMxvjHRS55rw1nwH]#8070
waterWang wants to merge 3 commits into
Scottcjn:mainfrom
waterWang:fix/8031-windows-miner-path

Conversation

@waterWang

Copy link
Copy Markdown
Contributor

Summary

Fixes #8031

The fingerprint_checks.py module exists in platform-specific subdirectories (miners/linux/, miners/windows/, miners/macos/) but there was no stub at miners/fingerprint_checks.py. This caused a Python path error (0x80070003 on Windows) when users ran python3 miners/fingerprint_checks.py.

Fix

Added a platform-detecting wrapper at miners/fingerprint_checks.py that:

  1. Detects the current OS (linux/windows/darwin) via platform.system()
  2. Loads the corresponding platform-specific module via importlib.util.spec_from_file_location
  3. Re-exports all public symbols for backward compatibility
  4. Runs the module's main() entry point if available

Test

  • Linux: platform.system().lower() == 'linux' → loads miners/linux/fingerprint_checks.py
  • Windows: platform.system().lower() == 'windows' → loads miners/windows/fingerprint_checks.py
  • macOS: platform.system().lower() == 'darwin' → loads miners/macos/fingerprint_checks.py
  • Unknown platform: falls back to linux

wangye and others added 3 commits July 26, 2026 21:31
…urning 0

Closes Scottcjn#8057

The _tip_age_slots() function was selecting the newest header slot
from the database but discarding the value, returning a hardcoded 0
if any row existed. This caused /health to report tip_age_slots: 0
even when the chain tip was months old.

Fix: compute the actual tip age by subtracting the latest header slot
from current_slot(), returning max(0, age) to handle edge cases.
Empty headers table still returns None.

[FaaFyfxR9WAQrL7FcAgEHJvztd8cVMxvjHRS55rw1nwH]
Closes Scottcjn#8055

The chain tip check result was omitted from both all_ok expressions:
1. In render() - the CLI output displayed ALL SYSTEMS OPERATIONAL even when /headers/tip was unreachable
2. In run_once() - the exit code was 0 (success) even when the tip check failed

Fix: add and t['reachable'] / and snapshot['tip']['reachable'] to both all_ok expressions.

[FaaFyfxR9WAQrL7FcAgEHJvztd8cVMxvjHRS55rw1nwH]
Closes Scottcjn#8031

The fingerprint_checks.py module exists in platform-specific subdirectories
(miners/linux/, miners/windows/, miners/macos/) but there was no stub at
miners/fingerprint_checks.py, causing users to get a Python path error
(0x80070003 on Windows) when running python3 miners/fingerprint_checks.py.

Fix: add a platform-detecting wrapper at miners/fingerprint_checks.py that:
1. Detects the current OS (linux/windows/darwin)
2. Loads the corresponding platform-specific module
3. Re-exports all public symbols for backward compatibility
4. Runs the module's main() entry point if available

[FaaFyfxR9WAQrL7FcAgEHJvztd8cVMxvjHRS55rw1nwH]
@waterWang
waterWang requested a review from Scottcjn as a code owner July 26, 2026 13:33
@github-actions

Copy link
Copy Markdown
Contributor

Welcome to RustChain! Thanks for your first pull request.

Before we review, please make sure:

  • Non-doc PRs have a BCOS-L1 or BCOS-L2 label
  • Doc-only PRs are exempt from BCOS tier labels when they only touch docs/**, *.md, or common image/PDF files
  • New code files include an SPDX license header
  • You've tested your changes against the live node

Bounty tiers: Micro (1-10 RTC) | Standard (20-50) | Major (75-100) | Critical (100-150)

A maintainer will review your PR soon. Thanks for contributing!

@github-actions github-actions Bot added BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) BCOS-L2 Beacon Certified Open Source tier BCOS-L2 (required for non-doc PRs) node Node server related size/M PR: 51-200 lines labels Jul 26, 2026
@waterWang

Copy link
Copy Markdown
Contributor Author

Closing as duplicate of PR #8059 (already submitted by the same author)

@waterWang waterWang closed this Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) BCOS-L2 Beacon Certified Open Source tier BCOS-L2 (required for non-doc PRs) node Node server related size/M PR: 51-200 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Windows miner path issue

1 participant